N2O valence (orbs 6 - 9) ePS results processing

20/03/24

Added basic MF-PAD results (linear polarization, $(x,y,z)$ alignments).

22/02/24 PH

1st processing for N2O results.


For methods: https://epsproc.readthedocs.io/en/dev/demos/ePSproc_class_demo_161020.html

Setup

In [28]:
# Quick hack to override default HTML template
# NOT required in some JLab versions.
# https://stackoverflow.com/a/63777508
# https://stackoverflow.com/questions/21971449/how-do-i-increase-the-cell-width-of-the-jupyter-ipython-notebook-in-my-browser
from IPython.core.display import display, HTML
display(HTML("<style>.container { width:100% !important; }</style>"))
In [1]:
import sys
import os
from pathlib import Path
import numpy as np
# import epsproc as ep
import xarray as xr

import matplotlib.pyplot as plt

from datetime import datetime as dt
timeString = dt.now()

import epsproc as ep

# Plotters
from epsproc.plot import hvPlotters

# Multijob class dev code
from epsproc.classes.multiJob import ePSmultiJob

hvPlotters.setPlotters(width = 700, snsStyle='whitegrid')
* sparse not found, sparse matrix forms not available. 
* natsort not found, some sorting functions not available. 
* Setting plotter defaults with epsproc.basicPlotters.setPlotters(). Run directly to modify, or change options in local env.
* Set Holoviews with bokeh.
* pyevtk not found, VTK export not available. 
* Set Holoviews with bokeh.
In [2]:
# For class, above settings don't take, not sure why, something to do with namespaces/calling sequence?
# Overriding snsStyle does work however... although NOT CONSISTENTLY????
# AH, looks like ordering matters - set_style LAST (.set seems to override)
import seaborn as sns

sns.set(rc={'figure.figsize':(10,6)})  # Set figure size in inches
sns.set_context("paper")
sns.set_style("whitegrid")  # Set plot style
sns.set_palette("Paired")   # Set colour mapping

# Try direct fig type setting for PDF output figs
from IPython.display import set_matplotlib_formats
# set_matplotlib_formats('png', 'pdf')
set_matplotlib_formats('svg', 'pdf')
In [3]:
# xr.set_options(display_style='html')

Load data

In [4]:
import warnings
# warnings.filterwarnings('once')   # Skip repeated numpy deprecation warnings in current build (xr15 env)
warnings.filterwarnings('ignore')   # Skip repeated numpy deprecation warnings in current build (xr15 env)
In [5]:
# # Scan for subdirs, based on existing routine in getFiles()

# fileBase = Path('/home/paul/ePS/OCS/OCS_survey')  # Data dir on Stimpy

fileBase = Path('/home/paul/fock-mount/globalhome/eps/N2O/N2O_valence') # Data dir on Jake
In [6]:
# TODO: fix orb label here, currently relies on (different) fixed format

data = ePSmultiJob(fileBase, verbose = 0)

data.scanFiles()
data.jobsSummary()
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
*** Warning: Missing records, expected 32, found 24.
*** Warning: Found 8 blank sets of matrix elements, symmetries ['A2']
Found 4 directories, with 16 files.

*** Job orb9_P details
Key: orb9_P
Dir /home/paul/fock-mount/globalhome/eps/N2O/N2O_valence/orb9_P, 4 file(s).
{   'batch': 'ePS N2O, batch N2O_valence, orbital orb9_P',
    'event': 'orb 9 (P/CAv) ionization, batch N2O_valence, None.',
    'orbE': -13.499568716634647,
    'orbLabel': 'orb9_P',
    'symmetryLabel': 'P/CAv'}

*** Job orb6_S details
Key: orb6_S
Dir /home/paul/fock-mount/globalhome/eps/N2O/N2O_valence/orb6_S, 4 file(s).
{   'batch': 'ePS N2O, batch N2O_valence, orbital orb6_S',
    'event': 'orb 6 (S/CAv) ionization, batch N2O_valence, None.',
    'orbE': -22.60177741591763,
    'orbLabel': 'orb6_S',
    'symmetryLabel': 'S/CAv'}

*** Job orb7_P details
Key: orb7_P
Dir /home/paul/fock-mount/globalhome/eps/N2O/N2O_valence/orb7_P, 4 file(s).
{   'batch': 'ePS N2O, batch N2O_valence, orbital orb7_P',
    'event': 'orb 7 (P/CAv) ionization, batch N2O_valence, None.',
    'orbE': -21.11331458826209,
    'orbLabel': 'orb7_P',
    'symmetryLabel': 'P/CAv'}

*** Job orb8_S details
Key: orb8_S
Dir /home/paul/fock-mount/globalhome/eps/N2O/N2O_valence/orb8_S, 4 file(s).
{   'batch': 'ePS N2O, batch N2O_valence, orbital orb8_S',
    'event': 'orb 8 (S/CAv) ionization, batch N2O_valence, None.',
    'orbE': -19.00715329282262,
    'orbLabel': 'orb8_S',
    'symmetryLabel': 'S/CAv'}

*** Job stacked details
Key: stacked
No 'job' info set for self.data[stacked].
In [27]:
# # Fix labels for plots
# for key in data.data.keys():
#     data.data[key]['jobNotes']['orbLabel'] = key
    

System properties

Note orbital numbering in table below:

  • Orb is Gamess file output orbital numbering, ordered by energy but not grouped by degeneracy.
  • OrbGrp is grouped numbering by degeneracy, also used by ePolyScat, and will be used for labels etc. below.
In [8]:
data.molSummary()
*** Molecular structure
2024-03-20T17:23:12.751912 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/
*** Molecular orbital list (from ePS output file)
EH = Energy (Hartrees), E = Energy (eV), NOrbGrp, OrbGrp, GrpDegen = degeneracies and corresponding orbital numbering by group in ePS, NormInt = single centre expansion convergence (should be ~1.0).
props Sym SymOrb EH Occ E NOrbGrp OrbGrp GrpDegen NormInt
orb
1 S 0.0 -20.6612 2.0 -562.219894 1.0 1.0 1.0 0.975090
2 S 0.0 -15.8503 2.0 -431.308635 1.0 2.0 1.0 0.975090
3 S 0.0 -15.7018 2.0 -427.267745 1.0 3.0 1.0 0.975090
4 S 0.0 -1.6338 2.0 -44.457963 1.0 4.0 1.0 0.975090
5 S 0.0 -1.4519 2.0 -39.508212 1.0 5.0 1.0 0.975090
6 S 0.0 -0.8306 2.0 -22.601777 1.0 6.0 1.0 0.975090
7 P 0.0 -0.7759 2.0 -21.113315 1.0 7.0 2.0 0.975090
8 P 0.0 -0.7759 2.0 -21.113315 2.0 7.0 2.0 0.999998
9 S 0.0 -0.6985 2.0 -19.007153 1.0 8.0 1.0 0.975090
10 P 0.0 -0.4961 2.0 -13.499569 1.0 9.0 2.0 0.975090
11 P 0.0 -0.4961 2.0 -13.499569 2.0 9.0 2.0 0.999998
*** Warning: some orbital convergences outside single-center expansion convergence tolerance (0.01):
[[ 7.  2.]
 [ 8.  2.]
 [10.  2.]
 [11.  2.]]

Plot cross-sections and betas

These are from ePolyScat's getCro function, and are LF (unaligned ensemble) results. This provides a good, if general, overview.

Overview (all symmetries, length gauge) vs. Eke

In [9]:
# NEED TO SET AGAIN AFTER CLASS IMPORT!
import warnings
# warnings.filterwarnings('once')   # Skip repeated numpy deprecation warnings in current build (xr15 env)
warnings.filterwarnings('ignore')   # Skip repeated numpy deprecation warnings in current build (xr15 env)
In [10]:
# Comparative plot over datasets (all symmetries only)
Etype = 'Eke'  # Set for Eke or Ehv energy scale
pGauge = 'L'
# Erange=[0, 100]  # Plot range (full range if not passed to function below)
# data.plotGetCroComp(pType='SIGMA', Etype = Etype, Erange = Erange, backend = 'hv')
data.plotGetCroComp(pType='SIGMA', pGauge = pGauge, Etype = Etype)
2024-03-20T17:23:13.342700 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/
In [11]:
# Comparative plot over datasets (all symmetries only)
data.plotGetCroComp(pType='BETA', Etype=Etype)
2024-03-20T17:23:13.813307 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/

Overview (all symmetries, length gauge) vs. Ehv

Same results as above, Ehv scale.

In [12]:
# Comparative plot over datasets (all symmetries only)
Etype = 'Ehv'  # Set for Eke or Ehv energy scale
pGauge = 'L'
# Erange=[0, 100]  # Plot range (full range if not passed to function below)
# data.plotGetCroComp(pType='SIGMA', Etype = Etype, Erange = Erange, backend = 'hv')
data.plotGetCroComp(pType='SIGMA', pGauge = pGauge, Etype = Etype)
2024-03-20T17:23:14.126908 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/
In [13]:
# Comparative plot over datasets (all symmetries only)
data.plotGetCroComp(pType='BETA', Etype=Etype)
2024-03-20T17:23:14.421373 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/
In [14]:
# TODO
# data.plotGetCroComp(pType='BETA', Etype=Etype, backend='hv')

Checks

In [15]:
# Betas vs. Gauge
data.plotGetCro(pType='BETA', Etype=Etype)
2024-03-20T17:23:16.028136 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/
2024-03-20T17:23:16.515296 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/
2024-03-20T17:23:16.978897 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/
2024-03-20T17:23:17.452208 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/
In [ ]:
 

Compute MF observables

MF-$\beta_{LM}$

Compute MF results for $(x,y,z)$ polarization geometry (linear polarization).

In [16]:
data.MFBLM()
In [17]:
data.BLMplot(dataType='MFBLM', thres = 1e-2, backend='hv')  # Passing a threshold value here will remove any spurious BLM parameters.
BLMplot set data and plots to self.plots['BLMplot']
Out[17]:
True

MF-PADs $(\theta,E)$ for $\phi$-summed case)

In [26]:
# Compute MFPADs from BLMs and sum over phi.
data.padPlot(dataType='MFBLM',
             pStyle='grid', reducePhi='sum')   #, backend='hv')
Using default sph betas.
Summing over dims: set()
Plotting from self.data[orb9_P][MFBLM], facetDims=['Labels', 'Eke'], pType=a with backend=mpl.
Grid plot: orb9_P, dataType: MFBLM, plotType: a
Using default sph betas.
Summing over dims: set()
Plotting from self.data[orb6_S][MFBLM], facetDims=['Labels', 'Eke'], pType=a with backend=mpl.
Grid plot: orb6_S, dataType: MFBLM, plotType: a
Using default sph betas.
Summing over dims: set()
Plotting from self.data[orb7_P][MFBLM], facetDims=['Labels', 'Eke'], pType=a with backend=mpl.
Grid plot: orb7_P, dataType: MFBLM, plotType: a
Using default sph betas.
Summing over dims: set()
Plotting from self.data[orb8_S][MFBLM], facetDims=['Labels', 'Eke'], pType=a with backend=mpl.
Grid plot: orb8_S, dataType: MFBLM, plotType: a
2024-03-20T17:41:07.792049 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/
2024-03-20T17:41:09.100484 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/
2024-03-20T17:41:10.345316 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/
2024-03-20T17:41:11.578181 image/svg+xml Matplotlib v3.3.4, https://matplotlib.org/

Versions

In [20]:
# print(data.jobInfo['ePolyScat'][0])
# print('Run: ' + jobInfo['Starting'][0].split('at')[1])
In [21]:
import scooby
scooby.Report(additional=['epsproc', 'xarray', 'jupyter'])
Out[21]:
Wed Mar 20 17:40:53 2024 EDT
OS Linux CPU(s) 64 Machine x86_64
Architecture 64bit Environment Jupyter
Python 3.7.10 | packaged by conda-forge | (default, Feb 19 2021, 16:07:37) [GCC 9.3.0]
epsproc 1.3.2-dev xarray 0.15.0 jupyter Version unknown
numpy 1.21.6 scipy 1.6.1 IPython 7.21.0
matplotlib 3.3.4 scooby 0.5.6
In [22]:
# Check current Git commit for local ePSproc version
!git -C {Path(ep.__file__).parent} branch
!git -C {Path(ep.__file__).parent} log --format="%H" -n 1
* 3d-AFPAD-dev
  dev
  master
a34745c2fdb8a2accc5a5fc71bbe14339ccf5e1c
In [23]:
# Check current remote commits
!git ls-remote --heads https://github.com/phockett/ePSproc
a34745c2fdb8a2accc5a5fc71bbe14339ccf5e1c	refs/heads/3d-AFPAD-dev
7e4270370d66df44c334675ac487c87d702408da	refs/heads/dev
1c0b8fd409648f07c85f4f20628b5ea7627e0c4e	refs/heads/master
69cd89ce5bc0ad6d465a4bd8df6fba15d3fd1aee	refs/heads/numba-tests
ea30878c842f09d525fbf39fa269fa2302a13b57	refs/heads/revert-9-master
baf0be0c962e8ab3c3df57c8f70f0e939f99cbd7	refs/heads/testDev

Env

In [24]:
!hostname
jake
In [25]:
!conda env list
# conda environments:
#
base                     /home/paul/anaconda3
automation               /home/paul/anaconda3/envs/automation
baseBK-250821            /home/paul/anaconda3/envs/baseBK-250821
baseBK-280321            /home/paul/anaconda3/envs/baseBK-280321
dataTests2022            /home/paul/anaconda3/envs/dataTests2022
ePSproc-v1.2             /home/paul/anaconda3/envs/ePSproc-v1.2
ePSproc-v1.2-dev         /home/paul/anaconda3/envs/ePSproc-v1.2-dev
epsTestConda             /home/paul/anaconda3/envs/epsTestConda
epsTestPip               /home/paul/anaconda3/envs/epsTestPip
epsTestPypi              /home/paul/anaconda3/envs/epsTestPypi
epsTestSetup             /home/paul/anaconda3/envs/epsTestSetup
epsdev                   /home/paul/anaconda3/envs/epsdev
epsdev-040821            /home/paul/anaconda3/envs/epsdev-040821
epsdev-040821-YMLnb      /home/paul/anaconda3/envs/epsdev-040821-YMLnb
epsdev-040821-YMLnb-bk     /home/paul/anaconda3/envs/epsdev-040821-YMLnb-bk
epsdev-0822              /home/paul/anaconda3/envs/epsdev-0822
epsdev-shared-100122  *  /home/paul/anaconda3/envs/epsdev-shared-100122
epsdev-xr13              /home/paul/anaconda3/envs/epsdev-xr13
epsdev-xr15              /home/paul/anaconda3/envs/epsdev-xr15
epsdev-xr17              /home/paul/anaconda3/envs/epsdev-xr17
epsdevTestYML            /home/paul/anaconda3/envs/epsdevTestYML
epsman                   /home/paul/anaconda3/envs/epsman
epsman-dev-shared-310122     /home/paul/anaconda3/envs/epsman-dev-shared-310122
fibre-sim                /home/paul/anaconda3/envs/fibre-sim
frog                     /home/paul/anaconda3/envs/frog
jbookTest                /home/paul/anaconda3/envs/jbookTest
jbookTestv2              /home/paul/anaconda3/envs/jbookTestv2
ldm                      /home/paul/anaconda3/envs/ldm
matlab                   /home/paul/anaconda3/envs/matlab
mfrecon090323            /home/paul/anaconda3/envs/mfrecon090323
qe-mini-example          /home/paul/anaconda3/envs/qe-mini-example
tmo-dev                  /home/paul/anaconda3/envs/tmo-dev

In [ ]: